package client;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;

public class Config {
	private static String name;

	static Properties p = new Properties();
	static {
		try {
			p.load(new FileReader("./res/client.properties"));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public static String getHost() {
		return p.getProperty("host");
	}
	
	public static String[] getCorbaParams() {
		if (p.getProperty("orb.initial.port") != null)
			return new String[] { "-ORBInitialPort", p.getProperty("orb.initial.port"), "-ORBInitialHost", getHost() };
		return new String[] { "-ORBInitialPort", "1050", "-ORBInitialHost", getHost() };
	}

	public static String getUsername() {
		return name;

	}

	public static void setUsername(String name) {
		Config.name = name;

	}
}
